import  requests

url = 'https://www.baidu.com/'
response = requests.get(url)
#Response
print(type(response))
#设置响应编码
response.encoding = 'utf-8'
#以字符串的形式 返回网络源码
print(response.text)

#返回一个url地址
print(response.url)

#二进制数据
print(response.content)
#响应码
print(response.status_code)
#响应头
print(response.headers)